package test;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

public class test {
    public static void main(String[] args) throws IOException {
        //创建好压缩流关联压缩包
        ZipOutputStream zos=new ZipOutputStream(new FileOutputStream("E:\\kl.zip"));
        //创建好了nnnn\bbb\g.txt路径
        ZipEntry entry=new ZipEntry("nnnn\\bbb\\g.txt");
        //把nnnn\bbb\g.txt放入压缩包当中
        zos.putNextEntry(entry);
        zos.closeEntry();

        zos.close();
    }
}
